package qianfeng.com.meijiadaka.viewholder.xiaojian;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.lemon.view.adapter.BaseViewHolder;
import qianfeng.com.meijiadaka.R;
import qianfeng.com.meijiadaka.bean.xiaojian.XiaoJianBean;

/**
 * Created by yanshihao on 2017/2/11.
 */

public class XJViewHolder extends BaseViewHolder<XiaoJianBean.ResultBean> {

    private ImageView iv1,iv2,iv3,iv4;
    public XJViewHolder(ViewGroup parent) {
        super(parent, R.layout.xiaojian_item);
    }

    @Override
    public void onInitializeView() {
        super.onInitializeView();
        iv1=findViewById(R.id.xiaojian_iv1);
        iv2=findViewById(R.id.xiaojian_iv2);
        iv3=findViewById(R.id.xiaojian_iv3);
        iv4=findViewById(R.id.xiaojian_iv4);
    }

    @Override
    public void setData(XiaoJianBean.ResultBean object) {
        super.setData(object);
        Glide.with(itemView.getContext()).load(object.getThumbUrl()).into(iv1);
        Glide.with(itemView.getContext()).load(object.getCommodities().get(0).getCommodityIcon()).into(iv2);
        Glide.with(itemView.getContext()).load(object.getCommodities().get(1).getCommodityIcon()).into(iv3);
        Glide.with(itemView.getContext()).load(object.getCommodities().get(2).getCommodityIcon()).into(iv4);
    }

    @Override
    public void onItemViewClick(XiaoJianBean.ResultBean object) {
        super.onItemViewClick(object);
    }
}
